﻿USE [testBANew]
GO

-- Navigations
DELETE FROM Navigations where Category = 1 and [Application] = N'2'
SET IDENTITY_INSERT [dbo].[Navigations] ON 
INSERT [dbo].[Navigations] ([ID], [ParentId], [Name], [Order], [Icon], [Url], [Category], [Application]) VALUES (20, 0, N'首页', 10, N'fa fa-fa', N'~/Home/Index', N'1', N'2')
INSERT [dbo].[Navigations] ([ID], [ParentId], [Name], [Order], [Icon], [Url], [Category], [Application]) VALUES (21, 0, N'用户管理', 60, N'fa fa-user', N'~/Home/Person', N'1', N'2')
SET IDENTITY_INSERT [dbo].[Navigations] OFF

-- Dicts
DELETE From Dicts Where Define = 1
Insert Dicts (Category, Name, Code, Define) values (N'云心理平台网站设置', N'网站标题', N'云心理专家平台', 1);
Insert Dicts (Category, Name, Code, Define) values (N'云心理平台网站设置', N'网站页脚', N'版权所有：云心理实验室.技术支持：云心理实验室', 1);
Insert Dicts (Category, Name, Code, Define) values (N'云心理平台网站设置', N'系统注销地址', N'http://localhost:2780/Home/Login', 1);
Insert Dicts (Category, Name, Code, Define) values (N'云心理平台网站设置', N'测试题图片地址', N'~/Content/images/exam/', 1);
update Dicts set Code='http://localhost:2780/Home/Index' where Category = N'网站设置' and Name = N'前台首页' and Define = 0;
INSERT Dicts (Category, Name, Code, Define) VALUES (N'应用程序', N'云心理', N'2', 0);
Insert Dicts (Category, Name, Code, Define) values (N'测试题图片地址', N'图片路径', N'~/Content/images/exam/', 1);
Insert Dicts (Category, Name, Code, Define) values (N'云心理平台网站设置', N'网站路径', N'http://localhost:2780/', 1);
Insert Dicts (Category, Name, Code, Define) values (N'云心理平台网站设置', N'接口路径', N'http://localhost:2781/api/', 1);
--NavigationRole
--增加个人中心三个操作的权限
DELETE FROM NavigationRole where RoleID=2 and  NavigationID between 20 and 21 ;
DELETE FROM NavigationRole where RoleID=1 and  NavigationID between 20 and 21 ;
INSERT [dbo].[NavigationRole] ( [NavigationID], [RoleID]) VALUES (20, 1)
INSERT [dbo].[NavigationRole] ( [NavigationID], [RoleID]) VALUES (20, 2)
INSERT [dbo].[NavigationRole] ( [NavigationID], [RoleID]) VALUES (21, 1)
INSERT [dbo].[NavigationRole] ( [NavigationID], [RoleID]) VALUES (21, 2)

--User
DELETE From Users where ID = 2
SET IDENTITY_INSERT [dbo].[Users] ON 
-- CPSYADMIN/123789
insert into Users (ID, UserName, Password, PassSalt, DisplayName, RegisterTime, ApprovedTime,ApprovedBy, [Description]) values (2, 'cpsyadmin', 'WiQ4gfJRxywpEnuvZHUSZoGHtutq+5L9DXPSCh11MOo=', 'ezHwPijZ1y1v8DSRV6w9v0/Q3dFC5rMwIoDnfT84h/cMFjj2', N'茶壶心理', GetDate(), GetDate(), 'system', N'系统默认创建')
SET IDENTITY_INSERT [dbo].[Users] OFF

DELETE FROM UserRole where UserID = 2
INSERT [dbo].[UserRole] ([UserID], [RoleID]) VALUES (2, 2)

